<template>
    <section class="question">
        <div class="contents">
            <textarea class="textarea" maxlength="1000" placeholder="输入您的问题" @input='fun'></textarea>
            <div class="textareatip"><span class="text">{{num}}</span>/1000</div>
        </div>

        <div class="anonymain">
            <button class="release"  disabled="disabled" >发布</button>
            <button class="cancel" onclick="javascript :history.back(-1);">取消</button>
        </div>
    </section>
</template>


<script type="text/javascript">
    export default {
        name:'nice',
        data(){
            return {
                num:0,
                disabled:true
            }
        },
        methods:{
            fun(){
                if(num == 0){
                    this.disabled = true
                }
                else{
                    this.disabled = false
                }
                this.num ++
            }
        }
    }
</script>


<style type="text/css" lang="less">
.question{
    padding: 20px 20px;
    .contents{
        position: relative;
        textarea{
            background: rgba(244,244,244,1);
            border: none;
            border-radius: 6px;
            width: 100%;
            height: 50vh;
            font-size: 15px;
        }
        .textareatip{
            position: absolute;
            right:0;
            bottom:10px;
        }
    }
    .anonymain{
        button{
            width:80%;
            display: block;
            margin: 1em auto;
            padding: 10px 0;
            border-radius:10px;
            background-color: #fff;
            border:none;
        }
        .release{
            background-color:#ccc;

        }



    }

}


</style>
